#!/bin/bash
./gradlew :machine:assemble
./gradlew :install:assemble
./gradlew :launch:assemble
./gradlew :party:assemble
./gradlew :u0:assemble
./gradlew :u1:assemble
./gradlew :u2:assemble
./gradlew :u3:assemble

rm -rf ./stable
mkdir ./stable

# 测试服务器
mkdir ./stable/test
cp ./machine/build/outputs/apk/debug/*.apk ./stable/test
cp ./install/build/outputs/apk/debug/*.apk ./stable/test
cp ./launch/build/outputs/apk/debug/*.apk ./stable/test
cp ./party/build/outputs/apk/debug/*.apk ./stable/test
cp ./u0/build/outputs/apk/debug/*.apk ./stable/test
cp ./u1/build/outputs/apk/debug/*.apk ./stable/test
cp ./u2/build/outputs/apk/debug/*.apk ./stable/test
cp ./u3/build/outputs/apk/debug/*.apk ./stable/test

# 正式服务器
mkdir ./stable/release
cp ./machine/build/outputs/apk/release/*.apk ./stable/release
cp ./install/build/outputs/apk/release/*.apk ./stable/release
cp ./launch/build/outputs/apk/release/*.apk ./stable/release
cp ./party/build/outputs/apk/release/*.apk ./stable/release
cp ./u0/build/outputs/apk/release/*.apk ./stable/release
cp ./u1/build/outputs/apk/release/*.apk ./stable/release
cp ./u2/build/outputs/apk/release/*.apk ./stable/release
cp ./u3/build/outputs/apk/release/*.apk ./stable/release

# 一包
rm -rf ./helper/src/main/assets
mkdir ./helper/src/main/assets
cp ./machine/build/outputs/apk/debug/*.apk ./helper/src/main/assets
cp ./install/build/outputs/apk/debug/*.apk ./helper/src/main/assets
cp ./launch/build/outputs/apk/debug/*.apk ./helper/src/main/assets
cp ./party/build/outputs/apk/debug/*.apk ./helper/src/main/assets
cp ./u0/build/outputs/apk/debug/*.apk ./helper/src/main/assets
cp ./u1/build/outputs/apk/debug/*.apk ./helper/src/main/assets
cp ./u2/build/outputs/apk/debug/*.apk ./helper/src/main/assets
cp ./u3/build/outputs/apk/debug/*.apk ./helper/src/main/assets
./gradlew :helper:assembleDebug
cp ./helper/build/outputs/apk/debug/*.apk ./stable/test/

rm -rf ./helper/src/main/assets
mkdir ./helper/src/main/assets
cp ./machine/build/outputs/apk/release/*.apk ./helper/src/main/assets
cp ./install/build/outputs/apk/release/*.apk ./helper/src/main/assets
cp ./launch/build/outputs/apk/release/*.apk ./helper/src/main/assets
cp ./party/build/outputs/apk/release/*.apk ./helper/src/main/assets
cp ./u0/build/outputs/apk/release/*.apk ./helper/src/main/assets
cp ./u1/build/outputs/apk/release/*.apk ./helper/src/main/assets
cp ./u2/build/outputs/apk/release/*.apk ./helper/src/main/assets
cp ./u3/build/outputs/apk/release/*.apk ./helper/src/main/assets
./gradlew :helper:assembleRelease
cp ./helper/build/outputs/apk/release/*.apk ./stable/release/


